using System;

namespace ACS.Compiler.Tables.Modes
{
    public abstract class Mode
    {
        public override bool Equals(object obj)
        {
            Mode m = obj as Mode;
            if (m != null)
            {
                return m.Index == Index;
            } else
            {
                return false;
            }
        }

        protected static int _globalIndex;

        protected static int GetNewIndex()
        {
            return _globalIndex ++;
        }

        public Mode()
        {
            _index = GetNewIndex();
        }

        private int _index;

        public int Index
        {
            get
            {
                return _index;
            }
        }

        public abstract string ToDeclareFormat();
    }
}